package com.eposi.eposigameinterface.adapter;

import com.eposi.eposigameinterface.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.RatingBar;
import android.widget.TextView;

public class ListLobbyAdapter extends BaseAdapter {

	private Context context;
	private LayoutInflater mInflater;

	public ListLobbyAdapter(Context context) {
		this.context = context;
		mInflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return 20;
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LobbyHolder holder;
		if (convertView == null) {
			holder = new LobbyHolder();
			convertView = mInflater
					.inflate(R.layout.list_room_lobby_item, null);
			holder.roomNumber = (TextView) convertView
					.findViewById(R.id.list_room_lobby_item_room_number);
			holder.roomTitle = (TextView) convertView
					.findViewById(R.id.list_room_lobby_item_title_room);
			holder.roomUser = (RatingBar) convertView
					.findViewById(R.id.list_room_lobby_item_user_rating);
			holder.roomMoneyLimit = (TextView) convertView
					.findViewById(R.id.list_room_lobby_item_money_limit);
			holder.roomType = (TextView) convertView
					.findViewById(R.id.list_room_lobby_item_type_play);
			convertView.setTag(holder);
		} else {
			holder = (LobbyHolder) convertView.getTag();
		}
		return convertView;
	}

	class LobbyHolder {
		TextView roomNumber;
		TextView roomTitle;
		RatingBar roomUser;
		TextView roomMoneyLimit;
		TextView roomType;
	}
}
